import { MessageContent } from "wukongimjssdk";
import { WK_MSG_TYPES } from "./wkim";

/**
 * 语音消息
 */
export default class VoiceMsg extends MessageContent {
	url;
	timeTrad;
	// 解码
	decodeJSON(content) {
		this.url = content["url"] || '';
		this.timeTrad = content["timeTrad"] || 0;
	}
	// 编码
	encodeJSON() {
		return { "url": this.url, "timeTrad": this.timeTrad };
	}
	get contentType() {
		return WK_MSG_TYPES.voice;
	}
}